import intl from '../locale';
/**
 * 常量以及映射表
 */

// 常量
const CONSTANTS = {
  CODECENTER: 'CODECENTER',
};

// 映射关系表
CONSTANTS.ENUM = {
  // API version
  api_version: {
    V3: '/v3',
    V4: '/v4',
    V5: '/v5',
  },

  access_level: {
    0: 'NO_ACCESS',
    5: 'ORG_EXTERNAL_MEMBER',
    10: 'GUEST',
    11: 'INDEPARTMENTOPEN',
    20: 'REPORTER',
    15: 'ORG_MEMBER',
    30: 'DEVELOPER',
    40: 'MASTER',
    50: 'OWNER',
    60: 'ORG_ADMIN',
    70: 'ORG_OWNER',
    100: 'ADMIN',
  },

  access_level_id: {
    NO_ACCESS: 0,
    ORG_EXTERNAL_MEMBER: 5,
    GUEST: 10,
    INDEPARTMENTOPEN: 11,
    REPORTER: 20,
    ORG_MEMBER: 15,
    DEVELOPER: 30,
    MASTER: 40,
    OWNER: 50,
    ORG_ADMIN: 60,
    ORG_OWNER: 70,
    ADMIN: 100,
  },

  org_role_access_level: {
    NO_ACCESS: 0,
    ORG_EXTERNAL_MEMBER: 5,
    ORG_MEMBER: 15,
    ORG_ADMIN: 60,
    ORG_OWNER: 70,
  },

  visibility_level: {
    //  无意义的占位符
    NONSENSE: -1,
    //  私有
    PRIVATE: 0,
    //  登陆才能访问
    INTERNAL: 10,
    //  公开
    PUBLIC: 20,
  },

  visibility_level_icon: {
    //  私有
    0: 'lock',
    //  登陆才能访问
    10: 'shield',
    //  公开
    20: 'globe',
  },

  visibility_level_text: {
    //  私有
    0: 'private',
    //  登陆才能访问
    10: 'internal',
    //  公开
    20: 'public',
  },

  // 活动的类型
  activity_action: {
    1: 'CREATED',
    2: 'UPDATED',
    3: 'CLOSED',
    4: 'REOPEN',
    5: 'PUSHED',
    6: 'COMMENTED',
    7: 'APPROVE',
    8: 'JOINED',
    9: 'LEFT',
    10: 'DESTROYED',
    11: 'CREATE_PROJECT',
    12: 'IMPORT_PROJECT',
    13: 'MERGE_TYPE',
    14: 'RESTORE',
    15: 'OPEN_PROJECT_CRYPTO',
    16: 'CLOSE_PROJECT_CRYPTO',
    17: 'REPO_UPDATED',
    18: 'MIRROR_SYNC',
  },

  // 页面资源类型
  path_resource_type: {
    PROJECT: 'PROJECT',
    GROUP: 'GROUP',
    PERSONAL_NAMESPACE: 'PERSONAL_NAMESPACE',
  },

  // 代码库import任务状态
  project_import_status: {
    NONE: 'none',
    STARTED: 'started',
    FINISHED: 'finished',
    FAILED: 'failed',
  },

  // 代码库transfer任务状态
  project_transfer_status: {
    PARKED: 'parked',
    WRONG: 'wrong',
    BEGINNING: 'beginning',
    SUCCESS: 'success',
  },

  tenant: {
    ALIBABA: 'ALIBABA', // 集团
    ALIYUN: 'ALIYUN', // 公有云
    VPC: 'VPC', // 专有云
  },

  // 三个规约级别对应的标签颜色
  violation_priority_color: {
    Blocker: 'red',
    Critical: 'yellow',
    Major: 'blue',
  },

  // 系统对应的角色
  role: {
    /**
     * 无权限
     */
    NO_ACCESS: intl.get({
      id: 'code-assets.src.utils.constants.NoPermission',
      defaultMessage: '无权限',
    }),
    /**
     *
     */
    ORG_EXTERNAL_MEMBER: intl.get({
      id: 'code-assets.src.utils.constants.NoPermission',
      defaultMessage: '无权限',
    }),
    /**
     *
     */
    GUEST: intl.get({ id: 'code-assets.src.utils.constants.Visitors', defaultMessage: '访客' }),
    /**
     *
     */
    INDEPARTMENTOPEN: '',
    /**
     *
     */
    REPORTER: intl.get({
      id: 'code-assets.src.utils.constants.Visitors.1',
      defaultMessage: '浏览者',
    }),
    /**
     *
     */
    ORG_MEMBER: '',
    /**
     *
     */
    DEVELOPER: intl.get({
      id: 'code-assets.src.utils.constants.Developers',
      defaultMessage: '开发者',
    }),
    /**
     *
     */
    MASTER: intl.get({
      id: 'code-assets.src.utils.constants.Administrator',
      defaultMessage: '管理员',
    }),
    /**
     *
     */
    OWNER: intl.get({
      id: 'code-assets.src.utils.constants.Administrator',
      defaultMessage: '管理员',
    }),
    /**
     *
     */
    ORG_ADMIN: intl.get({
      id: 'code-assets.src.utils.constants.EnterpriseAdministrator',
      defaultMessage: '企业管理员',
    }),
    /**
     *
     */
    ORG_OWNER: intl.get({
      id: 'code-assets.src.utils.constants.EnterpriseAdministrator',
      defaultMessage: '企业管理员',
    }),
    /**
     *
     */
    ADMIN: intl.get({
      id: 'code-assets.src.utils.constants.SuperAdministrator',
      defaultMessage: '超级管理员',
    }),
  },

  // 用户在当前企业的角色信息
  user_role: {
    ADMIN: 'ADMIN',
    ORG_EXTERNAL_MEMBER: 'ORG_EXTERNAL_MEMBER',
    ORG_MEMBER: 'ORG_MEMBER',
    ORG_ADMIN: 'ORG_ADMIN',
    ORG_OWNER: 'ORG_OWNER',
  },

  // Migrate task status
  migrate_task_status: {
    CREATED: 'CREATED',
    PROCESSING: 'PROCESSING',
    PARAMETER_LACK: 'PARAMETER_LACK',
    REPOSITORY_NOT_FOUND: 'REPOSITORY_NOT_FOUND',
    DISK_FULL: 'DISK_FULL',
    ALREADY_FINISHED: 'ALREADY_FINISHED',
    NOT_STANDARD: 'NOT_STANDARD',
    AUTHOR_INFO_NOT_EXIT: 'AUTHOR_INFO_NOT_EXIT',
    CREATE_DIRECOTRY_FAILED: 'CREATE_DIRECOTRY_FAILED',
    GIT_CLONE_FAILED: 'GIT_CLONE_FAILED',
    PROCESS_TAGS_FAILED: 'PROCESS_TAGS_FAILED',
    PROCESS_BRANCHES_FAILED: 'PROCESS_BRANCHES_FAILED',
    COMMAND_EXECUTED_FAILED: 'COMMAND_EXECUTED_FAILED',
    UPLOAD_TO_GIT_FAILED: 'UPLOAD_TO_GIT_FAILED',
    UNSUPPORTED_TASK_TYPE: 'UNSUPPORTED_TASK_TYPE',
    UNKNOWN_FAILED: 'UNKNOWN_FAILED',
    SCAN_USER_SUCCESS: 'SCAN_USER_SUCCESS',
    CONVERTING: 'CONVERTING',
    CONVERT_SUCCESS: 'CONVERT_SUCCESS',
    SUCCESS: 'SUCCESS',
  },

  // 可见性
  visibility_levels: [
    {
      value: 0,
      label: intl.get({ id: 'code-assets.src.utils.constants.Private', defaultMessage: '私有' }),
    },

    {
      value: 10,
      label: intl.get({
        id: 'code-assets.src.utils.constants.EnterpriseVisible',
        defaultMessage: '企业可见',
      }),
    },

    {
      value: 20,
      label: intl.get({ id: 'code-assets.src.utils.constants.Public', defaultMessage: '公开' }),
    },
  ],

  // 数据清除比例
  clearType: {
    none: 0,
    curPage: 1,
    all: 2,
  },

  checkState: {
    PASS: {
      text: intl.get({ id: 'code-assets.src.utils.constants.Pass', defaultMessage: '通过' }),
      iconType: 'tick-bold',
    },

    FAIL: {
      text: intl.get({ id: 'code-assets.src.utils.constants.Failed', defaultMessage: '不通过' }),
      iconType: 'remove',
    },

    ERROR: {
      text: intl.get({
        id: 'code-assets.src.utils.constants.RunException',
        defaultMessage: '运行异常',
      }),
      iconType: 'warning-o-fill',
    },

    RUNNING: {
      text: intl.get({ id: 'code-assets.src.utils.constants.Running', defaultMessage: '运行中' }),
      iconType: 'loading',
    },

    WARNING: {
      text: intl.get({
        id: 'code-assets.src.utils.constants.PassWithAlerts',
        defaultMessage: '通过（有告警）',
      }),
      iconType: 'warning-o-fill',
    },

    WAITING: {
      text: intl.get({ id: 'code-assets.src.utils.constants.Waiting', defaultMessage: '等待中' }),
      iconType: 'clock',
    },
  },

  scanState: {
    PASS: {
      text: intl.get({ id: 'code-assets.src.utils.constants.Pass', defaultMessage: '通过' }),
      color: 'green',
    },

    FAIL: {
      text: intl.get({ id: 'code-assets.src.utils.constants.Failed', defaultMessage: '不通过' }),
      color: 'red',
    },

    ERROR: {
      text: intl.get({
        id: 'code-assets.src.utils.constants.RunException',
        defaultMessage: '运行异常',
      }),
      color: 'red',
    },

    RUNNING: {
      text: intl.get({ id: 'code-assets.src.utils.constants.Running', defaultMessage: '运行中' }),
      color: 'blue',
    },

    WARNING: {
      text: intl.get({
        id: 'code-assets.src.utils.constants.PassWithAlerts',
        defaultMessage: '通过（有告警）',
      }),
      color: 'orange',
    },

    NONE: {
      text: intl.get({
        id: 'code-assets.src.utils.constants.NoPipelineIsSet',
        defaultMessage: '未设置流水线',
      }),
      color: undefined,
    },

    WAITING: {
      text: intl.get({ id: 'code-assets.src.utils.constants.Waiting', defaultMessage: '等待中' }),
      color: undefined,
    },
  },

  // 库内设置页面设置扫描选项
  testNames: [
    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.ScanJavaCodeSpecifications',
        defaultMessage: 'Java代码规约扫描',
      }),
      des: intl.get({
        id: 'code-assets.src.utils.constants.AlibabaJavaDevelopmentProtocolPlug',
        defaultMessage: '阿里巴巴 Java 开发规约插件支持',
      }),
      key: 'coding_guidelines_detection',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.SensitiveInformationDetection',
        defaultMessage: '敏感信息检测',
      }),
      des: intl.get({
        id: 'code-assets.src.utils.constants.AlibabaSensitiveInformationDetectionPlug',
        defaultMessage: '阿里巴巴敏感信息检测插件支持',
      }),
      key: 'sensitive_info_detection',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.RepetitionDetection',
        defaultMessage: '重复度检测',
      }),
      des: intl.get({
        id: 'code-assets.src.utils.constants.SupportForTheAlibabaRepeat',
        defaultMessage: '阿里巴巴重复度检测扫描插件支持',
      }),
      key: 'repeatability_detection',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.ComplexityDetection',
        defaultMessage: '复杂度检测',
      }),
      des: intl.get({
        id: 'code-assets.src.utils.constants.SupportForAlibabaSHeavy',
        defaultMessage: '阿里巴巴重复杂检测扫描插件支持',
      }),
      key: 'complexity_detection',
    },
  ],

  // 上述扫描触发类型
  triggerInfo: [
    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.CodeSubmissionTriggersScanning',
        defaultMessage: '代码提交触发扫描',
      }),
      value: 'commit_trigger',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.MergeRequestsToTriggerScanning',
        defaultMessage: '合并请求触发扫描',
      }),
      value: 'mr_trigger',
    },
  ],

  buildInTaskNames: [
    'P3C_INCREMENTAL',
    'SENSITIVE_INFO_INCREMENTAL',
    'DEPENDENCY_ANALYSE_INCREMENTAL',
    'PRECFIX_INCREMENTAL',
  ],

  // 扫描tag传入的类型
  buildTagType: {
    code: 'code',
    pipeline: 'pipeline',
  },

  // diff平铺模式改动的限制
  diffLimit: {
    maxFileCount: 50,
    maxLineCount: 15000,
  },

  // 语言和版本号
  languageOptions: {
    Java: {
      default: 'jdk1.8',
      versions: ['jdk1.6', 'jdk1.7', 'jdk1.8', 'jdk1.9', 'jdk11'],
    },

    Golang: {
      default: '1.11',
      versions: ['1.8', '1.9', '1.11', '1.12', '1.13'],
    },

    Python: {
      default: '3.7',
      versions: ['2.7', '3.5', '3.6', '3.7'],
    },

    'Node.js': {
      default: '12.2',
      versions: ['6.11', '7.10', '8.13', '9.11', '10.15', '11.15', '12.2'],
    },
  },

  // 触发文案
  triggerText: {
    USER_AUTHORIZATION: intl.get({
      id: 'code-assets.src.utils.constants.EnableDetectionTrigger',
      defaultMessage: '开启检测触发',
    }),
    CONFIG_EDITION: intl.get({
      id: 'code-assets.src.utils.constants.UpdateDetectionSettings',
      defaultMessage: '更新检测设置触发',
    }),
    COMMIT_FULL: intl.get({
      id: 'code-assets.src.utils.constants.SubmissionTrigger',
      defaultMessage: '提交触发',
    }),
    MANUAL_FULL: intl.get({
      id: 'code-assets.src.utils.constants.ManualTrigger',
      defaultMessage: '手动触发',
    }),
    default: intl.get({
      id: 'code-assets.src.utils.constants.SubmissionTrigger',
      defaultMessage: '提交触发',
    }),
  },

  // 区分系统，显示不同文案
  getOSKeyMap: () => {
    const isMac = /macintosh|mac os x/i.test(window.navigator.userAgent);
    return {
      ctrlKey: isMac ? 'metaKey' : 'ctrlKey',
      ctrlTxt: isMac ? '⌘' : 'Ctrl',
    };
  },
  // mr触发扫描中英文对照
  // 如果新增mr触发的扫描，此处需新增 + mr处扫描面板也要新增
  mrTriggerMap: {
    coding_guidelines_detection: intl.get({
      id: 'code-assets.src.utils.constants.JavaDevelopmentProtocol',
      defaultMessage: 'Java开发规约',
    }),
    sensitive_info_detection: intl.get({
      id: 'code-assets.src.utils.constants.SensitiveInformationScanning',
      defaultMessage: '敏感信息扫描',
    }),
    dependency_analysis: intl.get({
      id: 'code-assets.src.utils.constants.DependencyPackageVulnerabilityDetection',
      defaultMessage: '依赖包漏洞检测',
    }),
    precfix_detection: intl.get({
      id: 'code-assets.src.utils.constants.RecommendedCodePatches',
      defaultMessage: '代码补丁推荐',
    }),
  },

  // 库安全 issue状态以及对应的按钮状态
  issueStausMap: {
    resolved: {
      color: 'green',
      text: intl.get({ id: 'code-assets.src.utils.constants.Resolved', defaultMessage: '已解决' }),
      // 是否需要按钮， 0 无按钮； 1 忽略按钮； 2 重开按钮
      btnStatus: 0,
    },

    unresolved: {
      color: undefined,
      text: intl.get({
        id: 'code-assets.src.utils.constants.NotResolved',
        defaultMessage: '未解决',
      }),
      btnStatus: 1,
    },

    new: {
      color: undefined,
      text: intl.get({ id: 'code-assets.src.utils.constants.Add', defaultMessage: '新增' }),
      btnStatus: 1,
    },

    ignored: {
      color: 'green',
      text: intl.get({ id: 'code-assets.src.utils.constants.Ignored', defaultMessage: '已忽略' }),
      btnStatus: 2,
    },

    closed: {
      color: 'green',
      text: intl.get({ id: 'code-assets.src.utils.constants.Disabled', defaultMessage: '已关闭' }),
      btnStatus: 0,
    },

    reopened: {
      color: undefined,
      text: intl.get({ id: 'code-assets.src.utils.constants.Reopen', defaultMessage: '重新打开' }),
      btnStatus: 1,
    },
  },

  // 代码备份的类型
  backupTypes: {
    oss: '0', // 后续可能增加
  },
  // 阿里云location枚举
  regions: [
    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.ChinaQingdao',
        defaultMessage: '华北1（青岛）',
      }),
      value: 'cn-qingdao',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.ChinaBeijing',
        defaultMessage: '华北2（北京）',
      }),
      value: 'cn-beijing',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.ChinaZhangjiakou',
        defaultMessage: '华北3（张家口）',
      }),
      value: 'cn-zhangjiakou',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.ChinaHohhot',
        defaultMessage: '华北5（呼和浩特））',
      }),
      value: 'cn-huhehaote',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.ChinaHangzhou',
        defaultMessage: '华东1（杭州）',
      }),
      value: 'cn-hangzhou',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.ChinaShanghai',
        defaultMessage: '华东2（上海）',
      }),
      value: 'cn-shanghai',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.ChinaShenzhen',
        defaultMessage: '华南1（深圳）',
      }),
      value: 'cn-shenzhen',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.SouthwestChengdu',
        defaultMessage: '西南1（成都）',
      }),
      value: 'cn-chengdu',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.ChinaHongKong',
        defaultMessage: '中国（香港）',
      }),
      value: 'cn-hongkong',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.JapanTokyo',
        defaultMessage: '日本（东京）',
      }),
      value: 'ap-northeast-1',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.Singapore',
        defaultMessage: '新加坡',
      }),
      value: 'ap-southeast-1',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.AustraliaSydney',
        defaultMessage: '澳大利亚（悉尼）',
      }),
      value: 'ap-southeast-2',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.MalaysiaKualaLumpur',
        defaultMessage: '马来西亚（吉隆坡）',
      }),
      value: 'ap-southeast-3',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.IndonesiaJakarta',
        defaultMessage: '印度尼西亚（雅加达）',
      }),
      value: 'ap-southeast-5',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.IndiaMumbai',
        defaultMessage: '印度（孟买）',
      }),
      value: 'ap-south-1',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.UsVirginia',
        defaultMessage: '美国（弗吉尼亚）',
      }),
      value: 'us-east-1',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.UsSiliconValley',
        defaultMessage: '美国（硅谷）',
      }),
      value: 'us-west-1',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.UkLondon',
        defaultMessage: '英国（伦敦）',
      }),
      value: 'eu-west-1',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.UaeDubai',
        defaultMessage: '阿联酋（迪拜）',
      }),
      value: 'me-east-1',
    },

    {
      label: intl.get({
        id: 'code-assets.src.utils.constants.GermanyFrankfurt',
        defaultMessage: '德国（法兰克福）',
      }),
      value: 'eu-central-1',
    },
  ],
};

CONSTANTS.DEFAULT_PAGE_SIZE = 20;

CONSTANTS.getLevel = (num) => {
  if (num < 20) {
    return 'noAccess';
  }
  if (num >= 20 && num < 40) {
    return 'member';
  }
  if (num >= 40) {
    return 'admin';
  }
};

// 以下角色为企业管理员： ORG_ADMIN ORG_OWNER ADMIN
CONSTANTS.ORGANIZATION_ADMIN_ROLES = ['ORG_ADMIN', 'ORG_OWNER', 'ADMIN'];

// 以下角色为库管理员： MASTER OWNER ORG_ADMIN ORG_OWNER ADMIN
CONSTANTS.PROJECT_ADMIN_ROLES = ['MASTER', 'OWNER', 'ORG_ADMIN', 'ORG_OWNER', 'ADMIN'];

// 以下角色为组管理员： MASTER OWNER ORG_ADMIN ORG_OWNER ADMIN
CONSTANTS.GROUP_ADMIN_ROLES = ['MASTER', 'OWNER', 'ORG_ADMIN', 'ORG_OWNER', 'ADMIN'];

// 以下角色为有库写权限的成员： DEVELOPER MASTER OWNER ORG_ADMIN ORG_OWNER ADMIN
CONSTANTS.PROJECT_WRITE_ROLES = ['DEVELOPER', 'MASTER', 'OWNER', 'ORG_ADMIN', 'ORG_OWNER', 'ADMIN'];

// 开发者
CONSTANTS.PROJECT_DEVELOPER_ROLES = ['DEVELOPER'];
// 浏览者
CONSTANTS.PROJECT_VIEW_ROLES = [
  'ORG_EXTERNAL_MEMBER',
  'GUEST',
  'IN_DEPARTMENT_OPEN',
  'ORG_MEMBER',
  'REPORTER',
];
// 200 kb
CONSTANTS.DEFAULT_PICTURE_SIZE = 200 * 1024;

CONSTANTS.MAX_BLOB_SIZE = 100 * 1024;

CONSTANTS.MAX_IMG_BLOB_SIZE = 50 * 1024 * 1024;

// 评审最大diff数阈值，超过这个值，则统一不加载diff内容，需用户手动点击加载
// CONSTANTS.MAX_CR_DIFF_NUM = 50;
CONSTANTS.MAX_CR_DIFF_NUM = 1; // 因为force并发限制，现在改为全部异步加载
CONSTANTS.MAX_DIFF_NUM = 50; // 最大加载50个diff

// 评审单个diff最大大小阈值，超过这个值，则统一不加载diff内容，需用户手动点击加载
CONSTANTS.MAX_CR_DIFF_SIZE = 100 * 1024;

// 文档的应用名，现在有硬编码问题，将来要和应用中心一起解掉
// CONSTANTS.WIKI_APP_NAME = '文档';
CONSTANTS.WIKI_APP_ID = 'codeup';

// 导入代码库平台和名称
CONSTANTS.PLATFORM_TYPES = {
  PRIVATE_GITLAB: {
    name: intl.get({
      id: 'code-assets.src.utils.constants.UserCreatedGitlab',
      defaultMessage: '自建 GitLab',
    }),
    host: '',
  },

  GITLAB: {
    name: 'GitLab',
    host: 'https://gitlab.com/',
  },

  GITHUB: {
    name: 'GitHub',
    host: 'https://github.com/',
  },

  GITEE: {
    name: intl.get({ id: 'code-assets.src.utils.constants.CodeCloud', defaultMessage: '码云' }),
    host: 'https://gitee.com/',
  },

  ALIYUN: {
    name: intl.get({
      id: 'code-assets.src.utils.constants.AlibabaCloudCode',
      defaultMessage: '阿里云代码',
    }),
    host: 'http://code.aliyun.com',
  },

  CODING: {
    name: 'Coding',
    host: 'https://coding.net/',
  },
};

// pushrule检查名称
CONSTANTS.PUSHRULE_CHECKERS = {
  AONE_ID_CHECKER: 'AoneIdChecker',
  COMMIT_MESSAGE_CHECKER: 'CommitMessageChecker',
  COMMIT_AUTHOR_EMAIL_CHECKER: 'CommitAuthorEmailChecker',
};

export const {
  ENUM,
  getLevel,
  PROJECT_ADMIN_ROLES,
  PROJECT_WRITE_ROLES,
  ORGANIZATION_ADMIN_ROLES,
  PROJECT_DEVELOPER_ROLES,
  PROJECT_VIEW_ROLES,
  GROUP_ADMIN_ROLES,
} = CONSTANTS;
export const defaultPageSize = CONSTANTS.DEFAULT_PAGE_SIZE;
export const defaultPictureSize = CONSTANTS.DEFAULT_PICTURE_SIZE;
export const maxBlobSize = CONSTANTS.MAX_BLOB_SIZE;
export const maxImgBlobSize = CONSTANTS.MAX_IMG_BLOB_SIZE;

/**
 * 不同环境根路径不同，后端用全局变量告诉前端
 * 如公有云环境为独立域名，根路径为 /
 * 而专有云环境为多产品公用域名，根路径为 /codeup
 */
export const rootPath = window.FORCE.subRoute || '';

export default CONSTANTS;
